<div class="container clearfix">
	<div class="ui-contain">
		<div class="ui-region-list-area">
			
			
		<section class="135editor" style="border: 0px none;margin:20px 0; padding: 0px;">
		    <section class="135brush" style="white-space: normal;font-size: 14px; line-height: 25px; margin: 2px 0px; padding: 10px 10px; border: 2px dashed #dedcde;max-width: 100%;">
		       <p style="margin:0 0;"><strong>提示：</strong></p>
		       <p style="margin:0 0;text-indent:2em;">同一数据，自动存的草稿版本至多5条，手动保存产生的历史版本不限数目。</p>
		       <p style="margin:0 0;text-indent:2em;">仅付费后才会开始保存每次保存时的历史版本记录，三个月前的历史版本记录将被不定期被清除。</p>
		    </section>
		</section>
		
{{if count($CurrentUser['role_id']) > 1 }}
	<div class="ui-portlet">
	<p style="font-weight:bold;">草稿版本</p>	
		<?PHP
		     foreach($draftlist as $item) {
				$item = $item['Draft'];
    		?>	
	<li class="regionlist clearfix"><div class="regionleft">
		<div class="listauthor"> 
			版本时间： 
			<a href="/version_controls/viewdraft/{{$item['id']}}" target="_blank">
				{{$item['updated']}} &nbsp;&nbsp; {{$item['name']}}
			</a>
		</div>
		
	</div></li>
			<?php } ?>
			<div class="clear"></div>
			{{if empty($draftlist)}} <p>无</p>{{/if}}
	</div>		
	<div class="ui-portlet">		
		<p style="font-weight:bold;">保存版本</p>
		    <?PHP
		     foreach($datalist as $version) {
		    	$item = json_decode($version['VersionControl']['content'],true);
				$item = $item[$modelClass];
    		?>	
	<li class="regionlist clearfix"><div class="regionleft">
		<div style="float:right;">
			<?PHP 
			if($item['coverimg']){
				echo $this->Html->image("grey.gif", array('title'=>$item['name'],'class'=>'lazy','data-src'=>$item['coverimg'],));
			}
			?>
		</div>
		<div class="listauthor"> 
			版本时间：<small> {{$version['VersionControl']['created']}} </small> &nbsp;|&nbsp;
				{{eval 
			echo $this->Html->link(usubstr($item['name'],0,35), 
					'/version_controls/view/'.$modelClass.'/'.$item['id'].'/'.$version['VersionControl']['version_id'], 
					array('title'=>$item['name'],'target'=>'_blank','escape'=>false)
				);
			}}
		</div>
	</div></li>
		
			<?php } ?>
			
			<div class="clear"></div>
			{{if empty($datalist)}} <p>无</p>{{/if}}
	</div>
{{else}}
	<div class="alert alert-warning">您需要开通付费会员，才具备数据历史版本的权限</div>
{{/if}}	
		</div>
		<div style="margin-top:20px;">
			{{if count($CurrentUser['role_id'])==1}}
			<a href="http://www.135plat.com/" class="btn btn-primary" target="_blank">开通付费会员</a> &nbsp;&nbsp; 
			{{/if}}
			<a href="http://www.135editor.com/books/chapter/1/53" target="_blank">查看历史版本恢复操作说明</a>
		</div>
	</div>
	<div class="ui-contain">
	</div>
</div>